package com.pattern.design.architect.flow;

import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @author LIN
 * @date 2023-07-27 15:36
 */
public class Demo {

    static interface FlowInterface {
        FlowNode getNext(FlowInstance instance, FlowNode node, PathCondition condition);

        void complete(FlowPath path);

    }

    @Data
    static class FlowInstance {
        List<FlowNode> rectList;
        List<FlowPath> pathList;
    }

    @Data
    static class PathCondition {

        public boolean ifCondition(FlowNode from){
            String suggestion = from.getSuggestion();
            String nodeStatus = from.getNodeStatus();

            return false;
        }

    }

    @Data
    static class FlowPath {
        public String pathName;
        public FlowNode from;
        public FlowNode to;
        public PathCondition pathCondition;
    }

    @Data
    static class FlowNode<T> {
        public T formObject;
        public String flowId;
        public String nodeId;
        public String nodeName;
        public String nodeStatus;
        public String suggestion;
        public String suggestionDesc;
        public String curUserId;
        public String curUserName;
        public String result;
        public Date createTime;
        public Date approvelTime;

    }
}
